<!DOCTYPE HTML>
<html>
	<head>
		<title>耿商</title>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
		<link rel="stylesheet" data-th-href="@{/css/index/main.css}" />
		<noscript><link rel="stylesheet" data-th-href="@{/css/index/noscript.css}" /></noscript>
		<!-- Scripts -->
		<script data-th-src="@{/js/index/jquery.min.js}"></script>
		<script data-th-src="@{/js/index/browser.min.js}"></script>
		<script data-th-src="@{/js/index/breakpoints.min.js}"></script>
		<script data-th-src="@{/js/index/util.js}"></script>
		<script data-th-src="@{/js/index/main.js}"></script>
		
		<script data-th-inline="javascript">
		var gid = [[${gid}]];
		var isInit = false;
		</script>
		
		<script data-th-inline="javascript">
			$(function(){
				showType();
			})
			
			function showType(){
				$.post("/lr/type/list",{},function(data){
					$(data).each(function(i,item){
						$("#menu ul").append('<li><a href="/?typeid='+item.id+'">'+item.typeName+'</a></li>');
						showGoods();
					})
				})
			}
			
			function showGoods(){
				console.log(gid);
				$.post("/lr/goods/info/"+gid,{},function(data){
					$(".inner").find(".tiles").html("");
					$(".inner").find("h1").html("￥"+data.price);
					$(".inner").find(".pname").html(data.name);
					$(".inner").find(".pinfo").html(data.info);
					
					var pic = data.pic;
					if(pic!=null && pic != ""){
						var picArr = pic.split(";");
						$(picArr).each(function(i,item){
							var innerStr = '<article><span class="image"><img src="'+item+'" alt="" /></span></article>';
							$(".inner").find(".tiles").append(innerStr);
						})
					}
					
					//页面动作初始化
					if(!isInit){
						mainInit();
						isInit = true;
					}
				})
			}
		</script>
	</head>
	<body class="is-preload">
		<!-- Wrapper -->
			<div id="wrapper">

				<!-- Header -->
					<header id="header">
						<div class="inner">

							<!-- Logo -->
								<a href="/?typeid=" class="logo">
									<span class="symbol"><img src="/img/index/logo.svg" alt="" /></span><span class="title">返回首页</span>
								</a>

							<!-- Nav -->
								<nav>
									<ul>
										<li><a href="#menu">Menu</a></li>
									</ul>
								</nav>

						</div>
					</header>

				<!-- Menu -->
					<nav id="menu">
						<h2>Menu</h2>
						<ul>
							<!-- <li><a href="index.html">上新</a></li>
							<li><a href="generic.html">大衣风衣</a></li>
							<li><a href="generic.html">羽绒服</a></li>
							<li><a href="generic.html">裤子裙装</a></li>
							<li><a href="elements.html">内搭外套</a></li>
							<li><a href="elements.html">特价</a></li> -->
						</ul>
					</nav>

				<!-- Main -->
					<div id="main">
						<div class="inner">
							<h1>￥0</h1>
							<p class="pname">未查询到此商品信息</p>
							<p class="pinfo"></p>
							<section class="tiles">
								<!-- <article>
									<span class="image">
										<img src="/img/index/pic01.jpg" alt="" />
									</span>
								</article>
								<article class="style2">
									<span class="image">
										<img src="/img/index/pic01.jpg" alt="" />
									</span>
								</article> -->
							</section>
						</div>
					</div>

			</div>
	</body>
</html>